package com.example.appforphysician.fragment;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;

import com.example.appforphysician.R;
import com.example.appforphysician.adapter.ServiceConnector;
import com.example.appforphysician.adapter.ServiceConnector.PhysicianInfo;
import com.example.appforphysician.service.ParseJson;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

public class FragmentProfile extends Fragment {

	public static Fragment newInstance(Context context) {
		FragmentProfile f = new FragmentProfile();

		return f;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		ViewGroup root = (ViewGroup) inflater.inflate(
				R.layout.fragment_profile, null);
		
		PhysicianInfo pi = ServiceConnector.getSingleton().getPhysicianInfo();

		TextView tvShowName = (TextView) root.findViewById(R.id.tvShowName);
		tvShowName.setText(pi.name);

		TextView tvShowPhone = (TextView) root.findViewById(R.id.tvShowPhone);
		tvShowPhone.setText(pi.phone);

		TextView tvShowAddress = (TextView) root
				.findViewById(R.id.tvShowAddress);
		tvShowAddress.setText(pi.address);

		TextView tvShowSpecialist = (TextView) root
				.findViewById(R.id.tvShowSpecialist);
		tvShowSpecialist.setText(pi.specialist);

		TextView tvShowHopital = (TextView) root
				.findViewById(R.id.tvShowHopital);
		tvShowHopital.setText(pi.hospital);

		TextView tvShowHospitalHotline = (TextView) root
				.findViewById(R.id.tvShowHospitalHotline);
		tvShowHospitalHotline.setText(pi.hotline);

		return root;
	}

}